package org.sky.algorithm.linear;

/**
 * 单链表测试类
 *
 * @author fog
 * @date 2021/9/4
 */

public class NodeTest {

    public static void main(String[] args) {

        // 创建节点
        Node n1 = new Node(1);
        Node n2 = new Node(2);
        Node n3 = new Node(3);

        // 追加节点
        n1.append(n2).append(n3);

        // System.out.println(n1.next().getData());
        //
        // System.out.println(n1.next().isLast());

        n1.show();
        System.out.println("\n");
        n1.removeNext();
        n1.show();
        System.out.println("\n");
        n1.addNode(new Node(6));
        n1.show();
    }

}
